home *** CD-ROM | disk | FTP | other *** search
/ ShareWare OnLine 2 / ShareWare OnLine Volume 2 (CMS Software)(1993).iso / os2 / mklapi10.zip / TEST.BAS < prev    next >
BASIC Source File  |  1993-04-24  |  2KB  |  70 lines

  1. DEFINT A-K, M-Z
  2. DEFLNG L-M
  3. ' $INCLUDE: '\c2\mklapi\mklapi.inc'
  4. SPEED% = 2400
  5. PORT% = 2
  6. RC%   = 1
  7. RELAX% = 32
  8. BRANCH% = 34
  9. STRAIGHT% = 33
  10. SWITCH% = 253
  11. SNSMAX% = 3
  12. DIM cnt&(9)
  13. ' ----------------------------
  14. RC = MKLOPEN(PORT%, SPEED%)
  15. PRINT "Port=";PORT%;"Returncode MKLOPEN=";RC%;"TIME=";MKLMSECS&
  16. if rc = 0 then
  17.   MKLPOLL (SNSMAX%)
  18.   FOR I% = 0 TO 1
  19.     RC = MKLPUTC(SWITCH% * 256 + BRANCH%)
  20.     RC = MKLPUTC(SWITCH% * 256 + STRAIGHT%)
  21.     RC = MKLPUTC(RELAX%)
  22.     PRINT "Switchpoint (";SWITCH%;") branch/straight/off (";i%;")"
  23.   NEXT
  24.   rc = mklflush
  25.   if rc <> 0 then
  26.     PRINT "Flush not complete: ";rc%;" bytes purged"
  27.   end if
  28.   FOR I% = 0 TO 1
  29.     RC = MKLPUTC(SWITCH% * 256 + BRANCH%)
  30.     RC = MKLPUTC(SWITCH% * 256 + STRAIGHT%)
  31.     RC = MKLPUTC(RELAX%)
  32.     PRINT "Switchpoint (";SWITCH%;") branch/straight/off (";i%;")"
  33.   NEXT
  34.   'Expect commands be discarded when 'stop' issued without preceding mklflush!
  35.   rc = mklstop
  36.   'FOR I% = 0 TO 1
  37.   '  RC = MKLPUTC(SWITCH% * 256 + BRANCH%)
  38.   '  RC = MKLPUTC(SWITCH% * 256 + STRAIGHT%)
  39.   '  RC = MKLPUTC(RELAX%)
  40.   '  PRINT "Switchpoint (";SWITCH%;") branch/straight/off (";i%;")"
  41.   'NEXT
  42.   mklsleep(1000)
  43.   rc = mklgo(2)
  44.   mklsleep(1000)
  45.   FOR I% = 0 TO 1
  46.     RC = MKLPUTC(SWITCH% * 256 + BRANCH%)
  47.     RC = MKLPUTC(SWITCH% * 256 + STRAIGHT%)
  48.     RC = MKLPUTC(RELAX%)
  49.     PRINT "Switchpoint (";SWITCH%;") branch/straight/off (";i%;")"
  50.   NEXT
  51.   rc = mklflush
  52.   if rc <> 0 then
  53.     PRINT "Flush not complete: ";rc%;" bytes purged"
  54.   end if
  55.   'Expect result of last poll not completed when mklclose issued
  56.   mklsleep(1000)
  57.   MKLCLOSE
  58. end if
  59. print ""
  60. print " Commands accepted: ";mklstats(1)
  61. print "  S88 reads issued: ";mklstats(2)
  62. print "Commands discarded: ";mklstats(3)
  63. print " Bytes transmitted: ";mklstats(4)
  64. print "    Bytes received: ";mklstats(5)
  65. print "      Bytes purged: ";mklstats(6)
  66. print ""
  67. for i=7 to 15
  68.   print "counter";i;"="; mklstats&(i)
  69. next i
  70.